#ifndef COLORCHOOSER_H
#define COLORCHOOSER_H

#include <QWidget>

class ColorChooser : public QWidget
{
    Q_OBJECT
    Q_PROPERTY(QColor color READ color WRITE setColor)
public:
    explicit ColorChooser(QWidget *parent = 0);
    void setColor(QColor color);
    QColor color();
protected:
    virtual void paintEvent(QPaintEvent *);
    virtual void mousePressEvent(QMouseEvent *);
private slots:
    void colorReset();
    void colorTransparent();
private:
    QColor _color;
    QColor _oldColor;
    bool _colorSetted;
};

#endif // COLORCHOOSER_H
